import request from '@/api/index'
//登录
export const login = ({email,password}) =>request({url:'/api/auth/login',method:'post',params:{email,password}})
//登录用户信息
export const Logininformation = () =>request({url:'/api/admin/user'})
//首页统计
export const Homepagestatistics = () =>request({url:'/api/admin/index'})
//分类列表
export const Classificationlist = () =>request({url:'/api/admin/category'})
//添加分类
export const Addclassification = ({name,pid}) =>request({url:'/api/admin/category',method:'post',params:{name,pid}})
//用户列表
export const UserList = ({current,name,email,phone,pageSize}) =>request({url:'/api/admin/users',method:'get',params:{current,name,email,phone,pageSize}})
//用户禁用和启用
export const userforbidden = (user) =>request({url:`/api/admin/users/${user}/lock`,method:'patch'})
//添加用户
export const Adduser = ({name,email,password}) =>request({url:'/api/admin/users',method:'post',params:{name,email,password}})
//更新用户信息
export const Updateuserinformation = ({users,name,email}) =>request({url:`/api/admin/users/${users}`,params:{name,email}, method:'put'})
